package com.neusoft.shopingapi.dao;
import com.neusoft.shopingapi.entity.TypeEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.stereotype.Repository;
import java.util.List;

    @Repository
    public class TypeDAOImpl {
        @Autowired
        private JdbcTemplate jdbcTemplate;

        public List<TypeEntity> qureyAll(){
            String sql="select *from typeinfo";
            RowMapper<TypeEntity> rowMapper=new BeanPropertyRowMapper(TypeEntity.class);
            return jdbcTemplate.query(sql,rowMapper);
        }

    }
